<template>
	<view>
		<view class="title">
			找回密码
		</view>
		<view class="edit">
			<view class="cellphone">
				<image src="../../static/sj.png" mode=""></image>
				<input type="text" value="" placeholder="请输入手机号" />
			</view>
			<view class="verify">
				<image src="../../static/yz.png" mode=""></image>
				<input type="text" value="" placeholder="请输入验证码" />
				<view class="code" @click="captchaCountdown">{{!captchaTime?'获取验证码':captchaTime+'s'}}</view>
			</view>
		</view>
		 <view class="step" @click="code">下一步</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phoneNumber: '',
				captcha: '',
				captchaTime: 0,
			}
		},
		methods:{
			/* 
				验证码倒计时
			 */
			captchaCountdown(){
				if(this.captchaTime > 0){
					uni.showToast({
						title:'不能重复获取',
						icon:'none'
					})
					return ;
				}else {
					this.captchaTime = 60;
					 let timer = setInterval(()=>{
					 this.captchaTime--;
					 console.log(this.captchaTime)
					 if(this.captchaTime < 1){
						 clearInterval(timer);
						 this.captchaTime = 0
					 }
					 },1000)
				}
			},
			// 修改密码
			code(){
				uni.navigateTo({
				    url: 'pages/login/code'
				});
			}
		}

	}
</script>

<style>
	.title {
		color: #000000;
		font-size: 38rpx;
		width: 100%;
		text-align: center;
		font-weight: 600;
		padding-top: 52rpx;
	}

	.edit {
		margin: 0 49rpx;
		box-shadow: 0px 4rpx 28rpx 0px #D8D8D8;
		border-radius: 21rpx;
		margin-top: 86rpx;
		padding-bottom: 70rpx;
	}

	.cellphone {
		margin: 0 31rpx;
		border-bottom: 2rpx solid #CCCCCC;
		padding-top: 62rpx;
		display: flex;
		align-items: center;
	}

	.cellphone image {
		width: 61rpx;
		height: 61rpx;
		/* flex: 1; */
	}

	.cellphone input {
		margin-left: 17rpx;
		flex: 1;
		/* margin-top: 5rpx; */
	}

	.verify {
		margin: 0 31rpx;
		border-bottom: 2rpx solid #CCCCCC;
		padding-top: 36rpx;
		display: flex;
		align-items: center;
	}

	.verify image {
		width: 61rpx;
		height: 61rpx;
	}

	.verify input {
		margin-left: 17rpx;
		flex: 1;
	}

	.code {
		font-size: 30rpx;
		color: #2AAB39;
		padding-right: 25rpx;
	}
	.step{
		margin: 76rpx 49rpx 0 49rpx;
		color: #FFFFFF;
		background-color: #2AAB39;
		text-align: center;
		border-radius: 8rpx;
		font-size: 33rpx;
		padding: 33rpx 0;
		
	}
</style>
